package com.codeforces.contest.c305;

import java.math.BigInteger;
import java.util.Scanner;

public class _305B {

	static Scanner scanner = new Scanner(System.in);
	static BigInteger p, q;
	static int n;
	static BigInteger[] a;

	public static void main(String[] args) {
		p = scanner.nextBigInteger();
		q = scanner.nextBigInteger();
		n = scanner.nextInt();
		a = new BigInteger[n];
		for (int i=0;i<n;++i) {
			a[i] = scanner.nextBigInteger();
			if (i < n-1) {
				BigInteger tmp = q;
				q = p.subtract(a[i].multiply(q));
				p = tmp;
			}
			else {
				if (p.compareTo(a[i].multiply(q)) == 0) {
					System.out.println("YES");
				}
				else {
					System.out.println("NO");
				}
			}
		}
	}
	
	

}